<template>
    <div class="top-right-btn">
        <el-row>
            <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
                <el-button size="small" circle icon="Search" @click="toggleSearch()" />
            </el-tooltip>
            <el-tooltip class="item" effect="dark" content="刷新" placement="top">
                <el-button size="small" circle icon="Refresh" @click="refresh()" />
            </el-tooltip>
        </el-row>
    </div>
</template>

<script setup>
import {toRefs} from "vue";

const emit = defineEmits(['update:showSearch', 'queryTable'])
const props = defineProps({
    showSearch: {
        type: Boolean,
        default: true
    }
})

const { showSearch } = toRefs(props)

//切换搜索
function toggleSearch() {
    emit("update:showSearch", !showSearch.value);
}

//刷新
function refresh() {
    emit("queryTable");
}

</script>

<style scoped>

</style>